<!doctype html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">

<html>
<head>
<div th:replace="/console/layout :: head('管理员编辑','','')"></div>
<script src="http://parsleyjs.org/dist/parsley.min.js"></script>
<script th:src="@{/assets/js/page.edit.js}"></script>
</head>
<body>
	<div th:replace="/console/layout :: header"></div>

	<div th:replace="/console/layout :: sidebar('member_admin')"></div>

	<div id="page_content">
		<div id="page_content_inner">

			<ul class="uk-breadcrumb">
				<li><a th:href="@{/console/admin}">人员管理</a></li>
				<li><span>管理员编辑</span></li>
			</ul>

			<form id="main-form" class="uk-form-stacked" th:action="@{/console/admin/save}" method="post" th:object="${entity}"
				data-parsley-validate>
				<input type="hidden" th:field="*{id}">
				<div class="uk-margin">
					<label class="uk-form-label" for="input-username">账号</label>
					<div class="uk-form-controls">
						<input class="uk-input" id="input-username" th:field="*{username}" required data-parsley-required-message="账号不能为空"
							minlength="4" data-parsley-minlength-message="账号最小长度为4" type="text" placeholder="请输入账号">
					</div>
				</div>
				<div class="uk-margin">
					<label class="uk-form-label" for="input-password">密码</label>
					<div class="uk-form-controls">
						<input class="uk-input" id="input-password" th:data-parsley-required="${entity.new}?'true':'false'"
							data-parsley-required-message="密码不能为空" minlength="6" data-parsley-minlength-message="密码最小长度为4" name="rawPassword"
							value="" type="text" th:placeholder="'请输入密码'+(${entity.new}?'':'，留空则不修改密码')" onfocus="this.type='password'">
					</div>
				</div>
				<div class="uk-margin">
					<label class="uk-form-label" for="input-name">姓名</label>
					<div class="uk-form-controls">
						<input class="uk-input" id="input-name" th:field="*{name}" required data-parsley-required-message="姓名不能为空"
							minlength="2" data-parsley-minlength-message="姓名最小长度为2" type="text" placeholder="请输入姓名">
					</div>
				</div>
				<div class="uk-margin">
					<div class="uk-align-right">
						<button class="uk-button uk-button-primary" type="submit">保存</button>
						<button class="uk-button uk-button-default" id="back-button" type="button">返回列表</button>
					</div>
				</div>
			</form>

		</div>
	</div>

	<div th:replace="/console/layout :: footer"></div>

	<script type="text/javascript" th:inline="javascript">
		var base = /*[[${#httpServletRequest.getContextPath()}]]*/"";
	</script>
	<script type="text/javascript">
		$(function() {
			$("#page_content_inner").pageedit({
				baseUrl : base + "/console/admin"
			});
		});
	</script>
</body>
</html>
